package game.ui.script
{
	import engine.asset.*;
	import engine.core.*;
	//import game.messages.progression.*;
	import game.network.*;
	import game.ui.core.*;
	import game.ui.script.commands.*;
	
	public class RxUIScriptRunner
	{
		private var s_commandMap:Object;
		private var m_commands:Vector.<RxUICommand>;
		private var m_currentCommand:RxUICommand;
		private var m_currentIndex:int;
		private var m_running:Boolean = false;
		private var m_completeCallback:Function;
		private var m_tutorialName:String;
		private var m_tutorialFlag:uint;
		private var m_tutorialStepIndex:uint = 0;
		private static var s_scripts:Vector.<RxUIScriptRunner>;
		
		public function RxUIScriptRunner(param1:String = null, param2:uint = 0)
		{
			//this.s_commandMap = {shownotification:RxShowNotificationCommand, wait:RxWaitCommand, highlightentity:RxHighlightEntityCommand, requestmove:RxRequestMoveCommand, playdialogsequence:RxPlayDialogSequenceCommand, highlightuielement:RxHighlighUIElementCommand, end:RxEndActionCommand, changeactorteam:RxChangeActorTeamCommand, reporttelmetry:RxReportTelemetryCommand};
			this.m_commands = new Vector.<RxUICommand>;
			this.m_tutorialName = param1;
			this.m_tutorialFlag = param2;
		}
		
		public static function EndAll() : void
		{
			var _loc_1:RxUIScriptRunner = null;
			for each (_loc_1 in s_scripts)
			{
				
				_loc_1.End(false);
			}
		}
		
		public function End(param1:Boolean = true) : void
		{
			/*
			var _loc_2:RxUICommand = null;
			var _loc_3:int = 0;
			var _loc_4:RxProgression_TutorialEventMessage = null;
			this.m_running = false;
			for each (_loc_2 in this.m_commands)
			{
				
				_loc_2.SetCompleteCallback(null);
				_loc_2.End();
			}
			_loc_3 = s_scripts.indexOf(this);
			if (_loc_3 != -1)
			{
				s_scripts.splice(_loc_3, 1);
			}
			if (param1 && this.m_completeCallback != null)
			{
				this.m_completeCallback();
			}
			if (this.m_tutorialFlag != 0)
			{
				RxUI.SetTutorialComplete(this.m_tutorialFlag);
				_loc_4 = new RxProgression_TutorialEventMessage();
				_loc_4.tutorialFlag = this.m_tutorialFlag;
				_loc_4.event = RxProgression_TutorialEventMessage.EVENT_COMPLETED;
				RxTransactionServer.instance.SendMessage(_loc_4);
			}
			return;*/
		}
	}
}